package com.longjianghuasheng.logistics.business.grab_an_order

import android.annotation.SuppressLint
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.databinding.ItemGrabAnOrderBinding
import com.longjianghuasheng.logistics.entity.DriverFormListItem
import com.longjianghuasheng.logistics.ext.loadUrl

class GrabAnOrderAdapter :
    BaseQuickAdapter<DriverFormListItem, BaseDataBindingHolder<ItemGrabAnOrderBinding>>(R.layout.item_grab_an_order) {
    @SuppressLint("SetTextI18n")
    override fun convert(
        holder: BaseDataBindingHolder<ItemGrabAnOrderBinding>,
        item: DriverFormListItem
    ) {
        holder.dataBinding?.run {
            ivPhoto.loadUrl(item.picurl)
            tvDate.text = "发布时间：${item.create_time}"
            tvName.text = item.names
            tvStart.text = "起始地：${item.start_address}"
            tvEnd.text = "目的地：${item.end_address}"
            tvPrice.text = "￥${item.price}"
        }
    }
}